package cc.zy.base.hr.util;

import cc.zy.base.hr.entity.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author XiaoZheng
 * @date 2022/03/10 20:30:49
 */
public class TypeUtil {
    public static List<ZhongHang> getBOCExcel(List<Emolument> emolument){

        List<ZhongHang> bocs=new ArrayList<>();
        for(Emolument em:emolument){
            if("中行".equals(em.getBank())){
                ZhongHang zhongHang=new ZhongHang();
//                此处需要根据身份证号码查询银行卡号
                zhongHang.setAccount("6217000000000000");
                zhongHang.setName(em.getName());
                zhongHang.setAmount(em.getYinHangShiFa());
                zhongHang.setIdNumber(em.getIdCard());
                bocs.add(zhongHang);
            }
        }

        return bocs;
    }

    public static List<ZhaoHang> getZhaoHangExcel(List<Emolument> emolument){

        List<ZhaoHang> zhaoHangs=new ArrayList<>();
        for(Emolument em:emolument){
            if("招行".equals(em.getBank())){
                ZhaoHang zh=new ZhaoHang();
                zh.setName(em.getName());
                //                此处需要根据身份证号码查询银行卡号
                zh.setAccount("6217000000000000");
                zh.setAmount(em.getYinHangShiFa());
                zh.setBank(em.getBank());

                zhaoHangs.add(zh);
            }
        }
        return zhaoHangs;
    }

    public static List<PuFa> getPuFaExcel(List<Emolument> emolument){

        List<PuFa> pfs=new ArrayList<>();
        String bankName = "";

        for(Emolument em:emolument){
            PuFa pf=new PuFa();
            if ("浦发".equals(em.getBank())){
                //                此处需要根据身份证号码查询银行卡号
                pf.setAccount("6217000000000000");
                pf.setAmount(em.getYinHangShiFa());
                pf.setName(em.getName());

                pfs.add(pf);
            }
        }
        return pfs;
    }

    public static List<ChongQing> getChongQingExcel(List<Emolument> emolument){

        List<ChongQing> cqs=new ArrayList<>();
        String bankName = "";

        for(Emolument em:emolument){
            ChongQing cq=new ChongQing();
            bankName = em.getBank();

            if ("重庆".equals(em.getBank())){
                //                此处需要根据身份证号码查询银行卡号
                cq.setAccount("6217000000000000");
                cq.setAmount(em.getYinHangShiFa());
                cq.setName(em.getName());
            }
            cqs.add(cq);
        }
        return cqs;
    }
}

